﻿#pragma once

#include "CIParaWrapper.h"
#include "CTprgInfWrapper.h"
#include "CBuffer10Wrapper.h"
class CEventManager
{
public:
    CIParaWrapper *pIParaWrapper;     // x0 -> 0
    CTprgInfWrapper *pTprgInfWrapper; // x1 -> 4
    float *rawbagFreq;                // x2 -> 8
    int32_t eventWidth;               // x3 -> 12
    float eventSlope;                 // x4 -> 16
    float normalizeSlope;             // x5 -> 20
    float eventDrift;                 // x6 -> 24
    PKWD_MODE wdMode;                 // x7 -> 28
    int32_t tdoubleCount;             // x8 -> 32
    int32_t minHeight;                // x9 -> 36
    int32_t minArea;                  // x10 -> 40
    int32_t tailMode;                 // x11 -> 44
    int32_t autoNegative;             // x12 -> 48
    int32_t shouldSens;               // x13 -> 52
    int32_t iParaCalcCounter;         // x14 -> 56
    int32_t buffer0Time;              // x15 -> 60
    float drift0;                     // x16 -> 64
    float slope0;                     // x17 -> 68
    int32_t avgDiffHeight;            // x18 -> 72
    int32_t x19;                      // x19 -> 76
    int32_t rawbagFreqD10;            // x20 -> 80
    int32_t width0;                   // x21 -> 84
    float accDiffHeight;              // x22 -> 88
    float absDiffHeight;              // x23 -> 92
    int32_t x24;                      // x24 -> 96
    int32_t autoNegative0;            // x25 -> 100
    int32_t evType[32];               // x26 -> 104
    int32_t evCount[32];              // x58 -> 232
    float evPara[32];                 // x90 -> 360
    int32_t x122;                     // x122 -> 488
    int32_t topOrBottom;              // x123 -> 492
    int32_t x124;                     // x124 -> 496
    int32_t *hsMin;                   // x125 -> 500
    int32_t rawbagIdx;                // x126 -> 504
    int32_t rawbagVal;                // x127 -> 508

    CEventManager();

    void printSelf(char *captionUpper, int32_t deep);

    // sub_10001AEA
    CEventManager *init(CIParaWrapper *pIPara, CTprgInfWrapper *pTprgInf, float *rawbagFreq);

    // sub_10001B1C
    CEventManager *init_();

    // sub_10019B00
    CEventManager *clear();

    // sub_10019BB0
    int32_t getVibrateCount(float time);

    // sub_1001A840
    float getNormalizeSlope();

    // sub_1001A860
    float getSlope();

    // sub_1001AA00
    double getRawbagFreqValue();

    // sub_1001A1C0
    int32_t getSlopeX10();

    // sub_1001A9B0
    double getEventDrift();

    // sub_10001D64
    int32_t checkStop(int32_t checkTime);

    // sub_100023A6
    int32_t setEventData(int32_t counter);

    // sub_10019FF0
    int32_t divideX10_3(float val);

    // sub_1000232B
    double enlargeWidth0(int32_t counter);

    // sub_1001A060
    double divideFreq(float val);

    // sub_100025A3
    int32_t setEventTypes(int32_t vibraCount);

    // sub_10001DB8
    int32_t testParaCalcCounter();

    // sub_1001B680
    int32_t isSlopeNearZero();

    // sub_10001DED
    int32_t setIParaValues(CBuffer10Wrapper *pBuffer10Wrapper);

    // sub_1001B6C0
    int32_t turnOffAutoNegative();

    // sub_1001B710
    CEventManager *setWidth(int32_t width);

    // sub_1001B6F0
    CEventManager *setWidth0(int32_t width0);

    // sub_1000289C
    int32_t checkPrgItemEven(int32_t timeEnd, int32_t event, int32_t *count, int32_t flag);

    // sub_100022E3
    int32_t calcWidth0(int32_t val);
};